#ifndef __AT32PROJECT_HEADER_H
#define __AT32PROJECT_HEADER_H

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>


#include "at32f403a_407.h"
#include "system_at32f403a_407.h"

#ifndef  BOOTLOADER

#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "event_groups.h"
#include "semphr.h"


#include "SEGGER_RTT.h"
//#include <EventRecorder.h>

#define ARG_UNUSED(x) (void)x

#define BAD_RET_ASSERT() while(1)
	
static inline void debugDisplayArray(const void *data, size_t length)
{
   uint32_t i;

   //Dump the contents of the array
   for(i = 0; i < length; i++)
   {
      //Display current data byte
      SEGGER_RTT_printf(0, "%02" "x" " ", *((const uint8_t *) data + i));

      //End of current line?
      if((i % 16) == 15 || i == (length - 1))
      {
         SEGGER_RTT_printf(0, "\r\n");
      }
   }
}

#endif

#endif
